package bma.common.langutil.jmshell.cmdopt;

/**
 * Thrown when the parsed command-line contains an option that is not
 * recognised. <code>getMessage()</code> returns
 * an error string suitable for reporting the error to the user (in
 * English).
 */
public class UnknownOptionException extends OptionException {
	
	private static final long serialVersionUID = 1L;

	public UnknownOptionException( String optionName ) {
        this(optionName, "Unknown option '" + optionName + "'");
    }

    public UnknownOptionException( String optionName, String msg ) {
        super(msg);
        this.optionName = optionName;
    }

    /**
     * @return the name of the option that was unknown (e.g. "-u")
     */
    public String getOptionName() {
        return this.optionName;
    }

    private final String optionName;
}